<template>
	<view class="item_register" v-if="data.user || data.inviteUser">
		<view class="register_tit">
			<image class="item_x item_x1"
				src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/title_l.png"
				mode="aspectFill"></image>
			{{ title }}
			<image class="item_x item_x2"
				src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/title_r.png"
				mode="aspectFill"></image>
		</view>
		<view class="register_box">
			<!-- <invitation-item-item title="邀请人可得" :data="data.user" v-if="data.user"></invitation-item-item> -->

			<view class="register_item" v-if="data.user">
				<view class="register_item_tit">
					<image class="register_item_icon"
						src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/register_icon.png"
						mode="aspectFill"></image>
					<view class="register_item_des">邀请人可得</view>
				</view>
				<view class="register_item_box">
					<view class="register_item_center" v-if="data.user.giveCount">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.user.giveCount }}次</view>
							<view class="des">免服务费</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.user.bonusAmount">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.user.bonusAmount }}元</view>
							<view class="des">奖励金</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.user.giveIntegral">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.user.giveIntegral }}分</view>
							<view class="des">积分</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.user.couponDetailList" v-for="(item,index) in data.user.couponDetailList[0].marketCouponVoList" :key="index">
					    <image
					        class="register_item_center_icon"
					        src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
					        mode="aspectFill"
					    ></image>
					    <view class="register_item_center_des" v-if="item.couponTypeStr=='折扣券'">
					        <view class="money">
								{{item.couponQuota}}折
								<text v-if="item.rewardNumber !=1">X{{ item.rewardNumber }}</text>
							</view>
					        <view class="des">{{item.couponTypeStr}}</view>
					    </view>
						<view class="register_item_center_des" v-else>
					        <view class="money">
								￥{{item.couponQuota}}元
								<text v-if="item.rewardNumber !=1 ">X{{ item.rewardNumber }}</text>
							</view>
					        <view class="des">{{item.couponTypeStr}}</view>
					    </view>
					</view>
					<view class="register_item_center" v-if="data.user.cardDetailList" v-for="(item,index) in data.user.cardDetailList[0].marketCardVoList" :key="index">
					    <image
					        class="register_item_center_icon"
					        src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
					        mode="aspectFill"
					    ></image>
					    <view class="register_item_center_des">
					        <view class="money">
								<text v-if="item.cardTypeStr=='金额卡'">￥</text>
										{{item.cardQuota}}
								<text>{{item.cardTypeStr=='电量卡'?'度':item.cardTypeStr=='折扣卡'?'折':item.cardTypeStr=='次数卡'?'次':''}}</text></view>
					        <view class="des">{{item.cardTypeStr}}</view>
					    </view>
					</view>
				</view>
			</view>

			<!-- <invitation-item-item title="受邀人可得" :data="data.inviteUser" v-if="data.inviteUser"></invitation-item-item> -->

			<view class="register_item" v-if="data.inviteUser">
				<view class="register_item_tit">
					<image class="register_item_icon"
						src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/register_icon.png"
						mode="aspectFill"></image>
					<view class="register_item_des">受邀人可得</view>
				</view>
				<view class="register_item_box">
					<view class="register_item_center" v-if="data.inviteUser.giveCount">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.inviteUser.giveCount }}次</view>
							<view class="des">免服务费</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.inviteUser.bonusAmount">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.inviteUser.bonusAmount }}元</view>
							<view class="des">奖励金</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.inviteUser.giveIntegral">
						<image class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"></image>
						<view class="register_item_center_des">
							<view class="money">{{ data.inviteUser.giveIntegral }}分</view>
							<view class="des">积分</view>
						</view>
					</view>
					<view class="register_item_center" v-if="data.inviteUser.couponDetailList" v-for="(item,index) in data.inviteUser.couponDetailList[0].marketCouponVoList" :key="index">
						<image
							class="register_item_center_icon"
							src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
							mode="aspectFill"
						></image>
						<view class="register_item_center_des" v-if="item.couponTypeStr=='折扣券'">
					        <view class="money">
								{{item.couponQuota}}折
								<text v-if="item.rewardNumber !=1">X{{ item.rewardNumber }}</text>
							</view>
					        <view class="des">{{item.couponTypeStr}}</view>
					    </view>
						<view class="register_item_center_des" v-else>
					        <view class="money">
								￥{{item.couponQuota}}元
								<text v-if="item.rewardNumber !=1 ">X{{ item.rewardNumber }}</text>
							</view>
					        <view class="des">{{item.couponTypeStr}}</view>
					    </view>
                  </view>
				  <view class="register_item_center" v-if="data.inviteUser.cardDetailList" v-for="(item,index) in data.inviteUser.cardDetailList[0].marketCardVoList" :key="index">
				      <image
				          class="register_item_center_icon"
				          src="https://oos-cn.ctyunapi.cn/front-end/static/marketingImg/marketing/images/invitation/item_bg.png"
				          mode="aspectFill"
				      ></image>
				      <view class="register_item_center_des">
				          <view class="money">
							  <text v-if="item.cardTypeStr=='金额卡'">￥</text>
									{{item.cardQuota}}
							<text>{{item.cardTypeStr=='电量卡'?'度':item.cardTypeStr=='折扣卡'?'折':item.cardTypeStr=='次数卡'?'次':''}}</text></view>
				          <view class="des">{{item.cardTypeStr}}</view>
				      </view>
				  </view>
				</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts">
	// import zpMixins from '@/uni_modules/zp-mixins/index';
	// import invitationItemItem from './invitation-item-item.vue';
	// marketing/pages/invite/components/invitation-item/invitation-item.ts
	export default {
		components: {
			// invitationItemItem
		},
		data() {
			return {};
		},
		options: {
			styleIsolation: 'shared'
		},
		/**
		 * 组件的属性列表
		 */
		props: {
			title: {
				type: String,
				default: '这是标题'
			},
			data: {
				type: Object,
				default: () => ({
					user: {},

					inviteUser: {}
				})
			}
		},
		/**
		 * 组件的方法列表
		 */
		methods: {},
		created: function () { }
	};
</script>
<style lang="less">
	/* marketing/pages/invite/components/invitation-item/invitation-item.wxss */
	@import url("../../pages/invite/invitation/invitation.less");
</style>